home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / telecomm / zm16src.lzh / ZMODEM.H < prev   
C/C++ Source or Header  |  1988-05-19  |  4KB  |  112 lines

  1. /*
  2.  *                ACKNOWLEDGEMENTS
  3.  *
  4.  *    ZMDM was derived from rz/sz for Unix  posted by 
  5.  *    Chuck Forsberg (...!tektronix!reed!omen!caf ). We
  6.  *    thank him for his excellent code, and for giving
  7.  *    us permission to use and distribute his code and
  8.  *    documentation.
  9.  *
  10.  *    Atari St version by:
  11.  *        Jwahar Bammi
  12.  *            usenet: mandrill!bammi@{decvax,sun}.UUCP
  13.  *            csnet:  bammi@mandrill.ces.CWRU.edu
  14.  *            arpa:   bammi@mandrill.ces.CWRU.edu
  15.  *            CompuServe: 71515,155
  16.  */
  17.  
  18. /*
  19.  *   Z M O D E M . H     Manifest constants for ZMODEM
  20.  *    application to application file transfer protocol
  21.  *    01-15-87  Chuck Forsberg Omen Technology Inc
  22.  */
  23. #define ZPAD '*'    /* 052 Padding character begins frames */
  24. #define ZDLE 030    /* Ctrl-X Zmodem escape - `ala BISYNC DLE */
  25. #define ZDLEE (ZDLE^0100)    /* Escaped ZDLE as transmitted */
  26. #define ZBIN 'A'    /* Binary frame indicator */
  27. #define ZHEX 'B'    /* HEX frame indicator */
  28. #define ZBIN32 'C'    /* Binary frame with 32 bit FCS */
  29.  
  30. /* Frame types (see array "frametypes" in zm.c) */
  31. #define ZRQINIT    0    /* Request receive init */
  32. #define ZRINIT    1    /* Receive init */
  33. #define ZSINIT 2    /* Send init sequence (optional) */
  34. #define ZACK 3        /* ACK to above */
  35. #define ZFILE 4        /* File name from sender */
  36. #define ZSKIP 5        /* To sender: skip this file */
  37. #define ZNAK 6        /* Last packet was garbled */
  38. #define ZABORT 7    /* Abort batch transfers */
  39. #define ZFIN 8        /* Finish session */
  40. #define ZRPOS 9        /* Resume data trans at this position */
  41. #define ZDATA 10    /* Data packet(s) follow */
  42. #define ZEOF 11        /* End of file */
  43. #define ZFERR 12    /* Fatal Read or Write error Detected */
  44. #define ZCRC 13        /* Request for file CRC and response */
  45. #define ZCHALLENGE 14    /* Receiver's Challenge */
  46. #define ZCOMPL 15    /* Request is complete */
  47. #define ZCAN 16        /* Other end canned session with CAN*5 */
  48. #define ZFREECNT 17    /* Request for free bytes on filesystem */
  49. #define ZCOMMAND 18    /* Command from sending program */
  50. #define ZSTDERR 19    /* Output to standard error, data follows */
  51.  
  52. /* ZDLE sequences */
  53. #define ZCRCE 'h'    /* CRC next, frame ends, header packet follows */
  54. #define ZCRCG 'i'    /* CRC next, frame continues nonstop */
  55. #define ZCRCQ 'j'    /* CRC next, frame continues, ZACK expected */
  56. #define ZCRCW 'k'    /* CRC next, ZACK expected, end of frame */
  57. #define ZRUB0 'l'    /* Translate to rubout 0177 */
  58. #define ZRUB1 'm'    /* Translate to rubout 0377 */
  59.  
  60. /* zdlread return values (internal) */
  61. /* -1 is general error, -2 is timeout */
  62. #define GOTOR 0400
  63. #define GOTCRCE (ZCRCE|GOTOR)    /* ZDLE-ZCRCE received */
  64. #define GOTCRCG (ZCRCG|GOTOR)    /* ZDLE-ZCRCG received */
  65. #define GOTCRCQ (ZCRCQ|GOTOR)    /* ZDLE-ZCRCQ received */
  66. #define GOTCRCW (ZCRCW|GOTOR)    /* ZDLE-ZCRCW received */
  67. #define GOTCAN    (GOTOR|030)    /* CAN*5 seen */
  68.  
  69. /* Byte positions within header array */
  70. #define ZF0    3    /* First flags byte */
  71. #define ZF1    2
  72. #define ZF2    1
  73. #define ZF3    0
  74. #define ZP0    0    /* Low order 8 bits of position */
  75. #define ZP1    1
  76. #define ZP2    2
  77. #define ZP3    3    /* High order 8 bits of file position */
  78.  
  79. /* Bit Masks for ZRINIT flags byte ZF0 */
  80. #define CANFDX    01    /* Rx can send and receive true FDX */
  81. #define CANOVIO    02    /* Rx can receive data during disk I/O */
  82. #define CANBRK    04    /* Rx can send a break signal */
  83. #define CANCRY    010    /* Receiver can decrypt */
  84. #define CANLZW    020    /* Receiver can uncompress */
  85. #define CANFC32    040    /* Receiver can use 32 bit Frame Check */
  86.  
  87.  
  88. /* Parameters for ZFILE frame */
  89. /* Conversion options one of these in ZF0 */
  90. #define ZCBIN    1    /* Binary transfer - inhibit conversion */
  91. #define ZCNL    2    /* Convert NL to local end of line convention */
  92. #define ZCRESUM    3    /* Resume interrupted file transfer */
  93. /* Management options, one of these in ZF1 */
  94. #define ZMNEW    1    /* Transfer if source newer or longer */
  95. #define ZMCRC    2    /* Transfer if different file CRC or length */
  96. #define ZMAPND    3    /* Append contents to existing file (if any) */
  97. #define ZMCLOB    4    /* Replace existing file */
  98. #define ZMSPARS    5    /* Encoding for sparse file */
  99. #define ZMDIFF    6    /* Transfer if dates or lengths different */
  100. #define ZMPROT    7    /* Protect destination file */
  101. /* Transport options, one of these in ZF2 */
  102. #define ZTLZW    1    /* Lempel-Ziv compression */
  103. #define ZTCRYPT    2    /* Encryption */
  104. #define ZTRLE    3    /* Run Length encoding */
  105.  
  106. /* Parameters for ZCOMMAND frame ZF0 (otherwise 0) */
  107. #define ZCACK1    1    /* Acknowledge, then do command */
  108.  
  109. extern long rclhdr();
  110.  
  111. /* -eof- */
  112.